<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclcontext.cpp -->
  <title>QCLContext Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLContext</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLContext Class Reference</h1>
<!-- $$$QCLContext-brief -->
<p>The QCLContext class represents an OpenCL context. <a href="#details">More...</a></p>
<!-- @@@QCLContext -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLContext&gt;</pre><p>Inherited by <a href="qclcontextgl.html">QCLContextGL</a>.</p>
<p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qclcontext-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#QCLContext">QCLContext</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#dtor.QCLContext">~QCLContext</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#barrier">barrier</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#barrier-2">barrier</a></b> ( const QCLEventList &amp; <i>events</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#buildProgramFromBinaries">buildProgramFromBinaries</a></b> ( const QList&lt;QCLDevice&gt; &amp; <i>devices</i>, const QList&lt;QByteArray&gt; &amp; <i>binaries</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#buildProgramFromBinaryCode">buildProgramFromBinaryCode</a></b> ( const QByteArray &amp; <i>binary</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#buildProgramFromBinaryFile">buildProgramFromBinaryFile</a></b> ( const QString &amp; <i>fileName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#buildProgramFromSourceCode">buildProgramFromSourceCode</a></b> ( const QByteArray &amp; <i>sourceCode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#buildProgramFromSourceFile">buildProgramFromSourceFile</a></b> ( const QString &amp; <i>fileName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLCommandQueue </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#commandQueue">commandQueue</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> cl_context </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#contextId">contextId</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#create">create</a></b> ( QCLDevice::DeviceTypes <i>type</i> = QCLDevice::Default )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#create-2">create</a></b> ( const QList&lt;QCLDevice&gt; &amp; <i>devices</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLBuffer </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createBufferCopy">createBufferCopy</a></b> ( const void * <i>data</i>, size_t <i>size</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLBuffer </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createBufferDevice">createBufferDevice</a></b> ( size_t <i>size</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLBuffer </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createBufferHost">createBufferHost</a></b> ( void * <i>data</i>, size_t <i>size</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLCommandQueue </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createCommandQueue">createCommandQueue</a></b> ( cl_command_queue_properties <i>properties</i>, const QCLDevice &amp; <i>device</i> = QCLDevice() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage2D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage2DCopy">createImage2DCopy</a></b> ( const QCLImageFormat &amp; <i>format</i>, const void * <i>data</i>, const QSize &amp; <i>size</i>, QCLMemoryObject::Access <i>access</i>, int <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage2D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage2DCopy-2">createImage2DCopy</a></b> ( const QImage &amp; <i>image</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage2D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage2DDevice">createImage2DDevice</a></b> ( const QCLImageFormat &amp; <i>format</i>, const QSize &amp; <i>size</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage2D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage2DHost">createImage2DHost</a></b> ( const QCLImageFormat &amp; <i>format</i>, void * <i>data</i>, const QSize &amp; <i>size</i>, QCLMemoryObject::Access <i>access</i>, int <i>bytesPerLine</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage2D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage2DHost-2">createImage2DHost</a></b> ( QImage * <i>image</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage3D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage3DCopy">createImage3DCopy</a></b> ( const QCLImageFormat &amp; <i>format</i>, const void * <i>data</i>, int <i>width</i>, int <i>height</i>, int <i>depth</i>, QCLMemoryObject::Access <i>access</i>, int <i>bytesPerLine</i> = 0, int <i>bytesPerSlice</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage3D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage3DDevice">createImage3DDevice</a></b> ( const QCLImageFormat &amp; <i>format</i>, int <i>width</i>, int <i>height</i>, int <i>depth</i>, QCLMemoryObject::Access <i>access</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLImage3D </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createImage3DHost">createImage3DHost</a></b> ( const QCLImageFormat &amp; <i>format</i>, void * <i>data</i>, int <i>width</i>, int <i>height</i>, int <i>depth</i>, QCLMemoryObject::Access <i>access</i>, int <i>bytesPerLine</i> = 0, int <i>bytesPerSlice</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createProgramFromBinaries">createProgramFromBinaries</a></b> ( const QList&lt;QCLDevice&gt; &amp; <i>devices</i>, const QList&lt;QByteArray&gt; &amp; <i>binaries</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createProgramFromBinaryCode">createProgramFromBinaryCode</a></b> ( const QByteArray &amp; <i>binary</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createProgramFromBinaryFile">createProgramFromBinaryFile</a></b> ( const QString &amp; <i>fileName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createProgramFromSourceCode">createProgramFromSourceCode</a></b> ( const QByteArray &amp; <i>sourceCode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLProgram </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createProgramFromSourceFile">createProgramFromSourceFile</a></b> ( const QString &amp; <i>fileName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLSampler </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createSampler">createSampler</a></b> ( bool <i>normalizedCoordinates</i>, QCLSampler::AddressingMode <i>addressingMode</i>, QCLSampler::FilterMode <i>filterMode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLUserEvent </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createUserEvent">createUserEvent</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLVector&lt;T&gt; </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#createVector">createVector</a></b> ( int <i>size</i>, QCLMemoryObject::Access <i>access</i> = QCLMemoryObject::ReadWrite )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLCommandQueue </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLDevice </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#defaultDevice">defaultDevice</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QCLDevice&gt; </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#devices">devices</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#finish">finish</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#flush">flush</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#isCreated">isCreated</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> cl_int </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#lastError">lastError</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#marker">marker</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#release">release</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#setCommandQueue">setCommandQueue</a></b> ( const QCLCommandQueue &amp; <i>queue</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#setContextId">setContextId</a></b> ( cl_context <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#setLastError">setLastError</a></b> ( cl_int <i>error</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QCLImageFormat&gt; </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#supportedImage2DFormats">supportedImage2DFormats</a></b> ( cl_mem_flags <i>flags</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QCLImageFormat&gt; </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#supportedImage3DFormats">supportedImage3DFormats</a></b> ( cl_mem_flags <i>flags</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#sync">sync</a></b> ()</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qclcontext.html#errorName">errorName</a></b> ( cl_int <i>code</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QCLContext-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLContext class represents an OpenCL context.</p>
</div>
<p>See also <a href="qclcontextgl.html">QCLContextGL</a>.</p>
<!-- @@@QCLContext -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLContext[overload1]$$$QCLContext -->
<h3 class="fn"><a name="QCLContext"></a>QCLContext::QCLContext ()</h3>
<p>Constructs a new OpenCL context object. This constructor is typically followed by calls to setPlatform() and <a href="qclcontext.html#create">create</a>().</p>
<!-- @@@QCLContext -->
<!-- $$$~QCLContext[overload1]$$$~QCLContext -->
<h3 class="fn"><a name="dtor.QCLContext"></a>QCLContext::~QCLContext ()<tt> [virtual]</tt></h3>
<p>Destroys this OpenCL context object. If the underlying <a href="qclcontext.html#contextId">contextId</a>() has been created, then it will be released.</p>
<!-- @@@~QCLContext -->
<!-- $$$barrier[overload1]$$$barrier -->
<h3 class="fn"><a name="barrier"></a>void QCLContext::barrier ()</h3>
<p>Adds a barrier to the active command queue. All commands that were queued before this point must finish before any further commands added after this point are executed.</p>
<p>This function will return immediately and will not block waiting for the commands to finish. Use <a href="qclcontext.html#sync">sync</a>() to block until all queued commands finish.</p>
<p>See also <a href="qclcontext.html#marker">marker</a>() and <a href="qclcontext.html#sync">sync</a>().</p>
<!-- @@@barrier -->
<!-- $$$barrier$$$barrierconstQCLEventList& -->
<h3 class="fn"><a name="barrier-2"></a>void QCLContext::barrier ( const <a href="qcleventlist.html">QCLEventList</a> &amp; <i>events</i> )</h3>
<p>This is an overloaded function.</p>
<p>Adds a barrier to the active command queue that will prevent future commands from being executed until after all members of <i>events</i> have been signalled.</p>
<p>See also <a href="qclcontext.html#marker">marker</a>().</p>
<!-- @@@barrier -->
<!-- $$$buildProgramFromBinaries[overload1]$$$buildProgramFromBinariesconstQList<QCLDevice>&constQList<QByteArray>& -->
<h3 class="fn"><a name="buildProgramFromBinaries"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::buildProgramFromBinaries ( const QList&lt;<a href="qcldevice.html">QCLDevice</a>&gt; &amp; <i>devices</i>, const QList&lt;QByteArray&gt; &amp; <i>binaries</i> )</h3>
<p>Creates an OpenCL program object from the list of <i>binaries</i> for <i>devices</i> and then builds the program. Returns a null <a href="qclprogram.html">QCLProgram</a> if the program could not be built. The <i>binaries</i> and <i>devices</i> lists must have the same number of elements.</p>
<p>See also <a href="qclcontext.html#createProgramFromBinaries">createProgramFromBinaries</a>() and <a href="qclcontext.html#buildProgramFromBinaryCode">buildProgramFromBinaryCode</a>().</p>
<!-- @@@buildProgramFromBinaries -->
<!-- $$$buildProgramFromBinaryCode[overload1]$$$buildProgramFromBinaryCodeconstQByteArray& -->
<h3 class="fn"><a name="buildProgramFromBinaryCode"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::buildProgramFromBinaryCode ( const QByteArray &amp; <i>binary</i> )</h3>
<p>Creates an OpenCL program object from the supplied <i>binary</i> for <a href="qclcontext.html#defaultDevice">defaultDevice</a>() and then builds it. Returns a null <a href="qclprogram.html">QCLProgram</a> if the program could not be built.</p>
<p>This function can only load the binary for a single device. For multiple devices, use <a href="qclcontext.html#createProgramFromBinaries">createProgramFromBinaries</a>() instead.</p>
<p>See also <a href="qclcontext.html#createProgramFromBinaryCode">createProgramFromBinaryCode</a>(), <a href="qclcontext.html#buildProgramFromBinaryFile">buildProgramFromBinaryFile</a>(), and <a href="qclcontext.html#buildProgramFromBinaries">buildProgramFromBinaries</a>().</p>
<!-- @@@buildProgramFromBinaryCode -->
<!-- $$$buildProgramFromBinaryFile[overload1]$$$buildProgramFromBinaryFileconstQString& -->
<h3 class="fn"><a name="buildProgramFromBinaryFile"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::buildProgramFromBinaryFile ( const QString &amp; <i>fileName</i> )</h3>
<p>Creates an OpenCL program object from the binary contents of the supplied <i>fileName</i> for <a href="qclcontext.html#defaultDevice">defaultDevice</a>() and then builds it. Returns a null <a href="qclprogram.html">QCLProgram</a> if the program could not be built.</p>
<p>See also <a href="qclcontext.html#createProgramFromBinaryFile">createProgramFromBinaryFile</a>() and <a href="qclcontext.html#buildProgramFromBinaryCode">buildProgramFromBinaryCode</a>().</p>
<!-- @@@buildProgramFromBinaryFile -->
<!-- $$$buildProgramFromSourceCode[overload1]$$$buildProgramFromSourceCodeconstQByteArray& -->
<h3 class="fn"><a name="buildProgramFromSourceCode"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::buildProgramFromSourceCode ( const QByteArray &amp; <i>sourceCode</i> )</h3>
<p>Creates an OpenCL program object from the supplied <i>sourceCode</i> and then builds it. Returns a null <a href="qclprogram.html">QCLProgram</a> if the program could not be built.</p>
<p>See also <a href="qclcontext.html#createProgramFromSourceCode">createProgramFromSourceCode</a>() and <a href="qclcontext.html#buildProgramFromSourceFile">buildProgramFromSourceFile</a>().</p>
<!-- @@@buildProgramFromSourceCode -->
<!-- $$$buildProgramFromSourceFile[overload1]$$$buildProgramFromSourceFileconstQString& -->
<h3 class="fn"><a name="buildProgramFromSourceFile"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::buildProgramFromSourceFile ( const QString &amp; <i>fileName</i> )</h3>
<p>Creates an OpenCL program object from the contents of the supplied <i>fileName</i> and then builds it. Returns a null <a href="qclprogram.html">QCLProgram</a> if the program could not be built.</p>
<p>See also <a href="qclcontext.html#createProgramFromSourceFile">createProgramFromSourceFile</a>() and <a href="qclcontext.html#buildProgramFromSourceCode">buildProgramFromSourceCode</a>().</p>
<!-- @@@buildProgramFromSourceFile -->
<!-- $$$commandQueue[overload1]$$$commandQueue -->
<h3 class="fn"><a name="commandQueue"></a><a href="qclcommandqueue.html">QCLCommandQueue</a> QCLContext::commandQueue ()</h3>
<p>Returns the context's active command queue, which will be <a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a>() if the queue has not yet been set.</p>
<p>See also <a href="qclcontext.html#setCommandQueue">setCommandQueue</a>() and <a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a>().</p>
<!-- @@@commandQueue -->
<!-- $$$contextId[overload1]$$$contextId -->
<h3 class="fn"><a name="contextId"></a>cl_context QCLContext::contextId () const</h3>
<p>Returns the native OpenCL context identifier associated with this object.</p>
<p>See also <a href="qclcontext.html#setContextId">setContextId</a>().</p>
<!-- @@@contextId -->
<!-- $$$create[overload1]$$$createQCLDevice::DeviceTypes -->
<h3 class="fn"><a name="create"></a>bool QCLContext::create ( <a href="qcldevice.html#DeviceType-enum">QCLDevice::DeviceTypes</a> <i>type</i> = QCLDevice::Default )</h3>
<p>Creates a new OpenCL context that matches <i>type</i>. Does nothing if the context has already been created. The default value for <i>type</i> is <a href="qcldevice.html#DeviceType-enum">QCLDevice::Default</a>.</p>
<p>This function will search for the first platform that has a device that matches <i>type</i>. The following code can be used to select devices that match <i>type</i> on a specific platform:</p>
<pre class="highlightedCode brush: cpp">    context.create(QCLDevice::devices(type, platform));</pre>
<p>Returns true if the context was created; false otherwise. On error, the status can be retrieved by calling <a href="qclcontext.html#lastError">lastError</a>().</p>
<p>See also <a href="qclcontext.html#isCreated">isCreated</a>(), <a href="qclcontext.html#setContextId">setContextId</a>(), and <a href="qclcontext.html#release">release</a>().</p>
<!-- @@@create -->
<!-- $$$create$$$createconstQList<QCLDevice>& -->
<h3 class="fn"><a name="create-2"></a>bool QCLContext::create ( const QList&lt;<a href="qcldevice.html">QCLDevice</a>&gt; &amp; <i>devices</i> )</h3>
<p>Creates a new OpenCL context that matches <i>devices</i>. Does nothing if the context has already been created. All of the <i>devices</i> must be associated with the same platform.</p>
<p>Returns true if the context was created; false otherwise. On error, the status can be retrieved by calling <a href="qclcontext.html#lastError">lastError</a>().</p>
<p>See also <a href="qclcontext.html#isCreated">isCreated</a>(), <a href="qclcontext.html#setContextId">setContextId</a>(), and <a href="qclcontext.html#release">release</a>().</p>
<!-- @@@create -->
<!-- $$$createBufferCopy[overload1]$$$createBufferCopyconstvoid*size_tQCLMemoryObject::Access -->
<h3 class="fn"><a name="createBufferCopy"></a><a href="qclbuffer.html">QCLBuffer</a> QCLContext::createBufferCopy ( const void * <i>data</i>, size_t <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates an OpenCL memory buffer of <i>size</i> bytes in length, with the specified <i>access</i> mode.</p>
<p>The buffer is initialized with a copy of the contents of <i>data</i>. The application's <i>data</i> can be discarded after the buffer is created.</p>
<p>Returns the new OpenCL memory buffer object, or a null object if the buffer could not be created.</p>
<p>See also <a href="qclcontext.html#createBufferDevice">createBufferDevice</a>(), <a href="qclcontext.html#createBufferHost">createBufferHost</a>(), and <a href="qclcontext.html#createVector">createVector</a>().</p>
<!-- @@@createBufferCopy -->
<!-- $$$createBufferDevice[overload1]$$$createBufferDevicesize_tQCLMemoryObject::Access -->
<h3 class="fn"><a name="createBufferDevice"></a><a href="qclbuffer.html">QCLBuffer</a> QCLContext::createBufferDevice ( size_t <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates an OpenCL memory buffer of <i>size</i> bytes in length, with the specified <i>access</i> mode.</p>
<p>The memory is created on the device and will not be accessible to the host via a direct pointer. Use <a href="qclcontext.html#createBufferHost">createBufferHost</a>() to create a host-accessible buffer.</p>
<p>Returns the new OpenCL memory buffer object, or a null object if the buffer could not be created.</p>
<p>See also <a href="qclcontext.html#createBufferHost">createBufferHost</a>(), <a href="qclcontext.html#createBufferCopy">createBufferCopy</a>(), and <a href="qclcontext.html#createVector">createVector</a>().</p>
<!-- @@@createBufferDevice -->
<!-- $$$createBufferHost[overload1]$$$createBufferHostvoid*size_tQCLMemoryObject::Access -->
<h3 class="fn"><a name="createBufferHost"></a><a href="qclbuffer.html">QCLBuffer</a> QCLContext::createBufferHost ( void * <i>data</i>, size_t <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates an OpenCL memory buffer of <i>size</i> bytes in length, with the specified <i>access</i> mode.</p>
<p>If <i>data</i> is not null, then it will be used as the storage for the buffer. If <i>data</i> is null, then a new block of host-accessible memory will be allocated.</p>
<p>Returns the new OpenCL memory buffer object, or a null object if the buffer could not be created.</p>
<p>See also <a href="qclcontext.html#createBufferDevice">createBufferDevice</a>(), <a href="qclcontext.html#createBufferCopy">createBufferCopy</a>(), and <a href="qclcontext.html#createVector">createVector</a>().</p>
<!-- @@@createBufferHost -->
<!-- $$$createCommandQueue[overload1]$$$createCommandQueuecl_command_queue_propertiesconstQCLDevice& -->
<h3 class="fn"><a name="createCommandQueue"></a><a href="qclcommandqueue.html">QCLCommandQueue</a> QCLContext::createCommandQueue ( cl_command_queue_properties <i>properties</i>, const <a href="qcldevice.html">QCLDevice</a> &amp; <i>device</i> = QCLDevice() )</h3>
<p>Creates a new command queue on this context for <i>device</i> with the specified <i>properties</i>. If <i>device</i> is null, then <a href="qclcontext.html#defaultDevice">defaultDevice</a>() will be used instead.</p>
<p>Unlike <a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a>(), this function will create a new queue every time it is called. The queue will be deleted when the last reference to the returned object is removed.</p>
<p>See also <a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a>() and <a href="qclcontext.html#lastError">lastError</a>().</p>
<!-- @@@createCommandQueue -->
<!-- $$$createImage2DCopy[overload1]$$$createImage2DCopyconstQCLImageFormat&constvoid*constQSize&QCLMemoryObject::Accessint -->
<h3 class="fn"><a name="createImage2DCopy"></a><a href="qclimage2d.html">QCLImage2D</a> QCLContext::createImage2DCopy ( const <a href="qclimageformat.html">QCLImageFormat</a> &amp; <i>format</i>, const void * <i>data</i>, const QSize &amp; <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, int <i>bytesPerLine</i> = 0 )</h3>
<p>Creates a 2D OpenCL image object with the specified <i>format</i>, <i>size</i>, and <i>access</i> mode. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>.</p>
<p>The image is initialized with a copy of the contents of <i>data</i>. The application's <i>data</i> can be discarded after the image is created.</p>
<p>Returns the new 2D OpenCL image object, or a null object if the image could not be created.</p>
<p>See also <a href="qclcontext.html#createImage2DDevice">createImage2DDevice</a>() and <a href="qclcontext.html#createImage2DHost">createImage2DHost</a>().</p>
<!-- @@@createImage2DCopy -->
<!-- $$$createImage2DCopy$$$createImage2DCopyconstQImage&QCLMemoryObject::Access -->
<h3 class="fn"><a name="createImage2DCopy-2"></a><a href="qclimage2d.html">QCLImage2D</a> QCLContext::createImage2DCopy ( const QImage &amp; <i>image</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates a 2D OpenCL image object from <i>image</i> with the specified <i>access</i> mode.</p>
<p>The OpenCL image is initialized with a copy of the contents of <i>image</i>. The application's <i>image</i> can be discarded after the OpenCL image is created.</p>
<p>Returns the new 2D OpenCL image object, or a null object if the image could not be created. If <i>image</i> has a zero size, this function will return a null <a href="qclimage2d.html">QCLImage2D</a> object.</p>
<p>See also <a href="qclcontext.html#createImage2DDevice">createImage2DDevice</a>() and <a href="qclcontext.html#createImage2DHost">createImage2DHost</a>().</p>
<!-- @@@createImage2DCopy -->
<!-- $$$createImage2DDevice[overload1]$$$createImage2DDeviceconstQCLImageFormat&constQSize&QCLMemoryObject::Access -->
<h3 class="fn"><a name="createImage2DDevice"></a><a href="qclimage2d.html">QCLImage2D</a> QCLContext::createImage2DDevice ( const <a href="qclimageformat.html">QCLImageFormat</a> &amp; <i>format</i>, const QSize &amp; <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates a 2D OpenCL image object with the specified <i>format</i>, <i>size</i>, and <i>access</i> mode.</p>
<p>The image memory is created on the device and will not be accessible to the host via a direct pointer. Use <a href="qclcontext.html#createImage2DHost">createImage2DHost</a>() to create a host-accessible image.</p>
<p>Returns the new 2D OpenCL image object, or a null object if the image could not be created.</p>
<p>See also <a href="qclcontext.html#createImage2DHost">createImage2DHost</a>() and <a href="qclcontext.html#createImage2DCopy">createImage2DCopy</a>().</p>
<!-- @@@createImage2DDevice -->
<!-- $$$createImage2DHost[overload1]$$$createImage2DHostconstQCLImageFormat&void*constQSize&QCLMemoryObject::Accessint -->
<h3 class="fn"><a name="createImage2DHost"></a><a href="qclimage2d.html">QCLImage2D</a> QCLContext::createImage2DHost ( const <a href="qclimageformat.html">QCLImageFormat</a> &amp; <i>format</i>, void * <i>data</i>, const QSize &amp; <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, int <i>bytesPerLine</i> = 0 )</h3>
<p>Creates a 2D OpenCL image object with the specified <i>format</i>, <i>size</i>, and <i>access</i> mode. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>.</p>
<p>If <i>data</i> is not null, then it will be used as the storage for the image. If <i>data</i> is null, then a new block of host-accessible memory will be allocated.</p>
<p>Returns the new 2D OpenCL image object, or a null object if the image could not be created.</p>
<p>See also <a href="qclcontext.html#createImage2DDevice">createImage2DDevice</a>() and <a href="qclcontext.html#createImage2DCopy">createImage2DCopy</a>().</p>
<!-- @@@createImage2DHost -->
<!-- $$$createImage2DHost$$$createImage2DHostQImage*QCLMemoryObject::Access -->
<h3 class="fn"><a name="createImage2DHost-2"></a><a href="qclimage2d.html">QCLImage2D</a> QCLContext::createImage2DHost ( QImage * <i>image</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates a 2D OpenCL image object from <i>image</i> with the specified <i>access</i> mode.</p>
<p>OpenCL kernels that access the image will read and write the QImage contents directly.</p>
<p>Returns the new 2D OpenCL image object, or a null object if the image could not be created. If <i>image</i> is null or has a zero size, this function will return a null <a href="qclimage2d.html">QCLImage2D</a> object.</p>
<p>See also <a href="qclcontext.html#createImage2DDevice">createImage2DDevice</a>() and <a href="qclcontext.html#createImage2DCopy">createImage2DCopy</a>().</p>
<!-- @@@createImage2DHost -->
<!-- $$$createImage3DCopy[overload1]$$$createImage3DCopyconstQCLImageFormat&constvoid*intintintQCLMemoryObject::Accessintint -->
<h3 class="fn"><a name="createImage3DCopy"></a><a href="qclimage3d.html">QCLImage3D</a> QCLContext::createImage3DCopy ( const <a href="qclimageformat.html">QCLImageFormat</a> &amp; <i>format</i>, const void * <i>data</i>, int <i>width</i>, int <i>height</i>, int <i>depth</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, int <i>bytesPerLine</i> = 0, int <i>bytesPerSlice</i> = 0 )</h3>
<p>Creates a 3D OpenCL image object with the specified <i>format</i>, <i>width</i>, <i>height</i>, <i>depth</i>, and <i>access</i> mode. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>. If <i>bytesPerSlice</i> is not zero, it indicates the number of bytes between slices in <i>data</i>.</p>
<p>The image is initialized with a copy of the contents of <i>data</i>. The application's <i>data</i> can be discarded after the image is created.</p>
<p>Returns the new 3D OpenCL image object, or a null object if the image could not be created.</p>
<p>See also <a href="qclcontext.html#createImage3DDevice">createImage3DDevice</a>() and <a href="qclcontext.html#createImage3DHost">createImage3DHost</a>().</p>
<!-- @@@createImage3DCopy -->
<!-- $$$createImage3DDevice[overload1]$$$createImage3DDeviceconstQCLImageFormat&intintintQCLMemoryObject::Access -->
<h3 class="fn"><a name="createImage3DDevice"></a><a href="qclimage3d.html">QCLImage3D</a> QCLContext::createImage3DDevice ( const <a href="qclimageformat.html">QCLImageFormat</a> &amp; <i>format</i>, int <i>width</i>, int <i>height</i>, int <i>depth</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> )</h3>
<p>Creates a 3D OpenCL image object with the specified <i>format</i>, <i>width</i>, <i>height</i>, <i>depth</i>, and <i>access</i> mode.</p>
<p>The image memory is created on the device and will not be accessible to the host via a direct pointer. Use <a href="qclcontext.html#createImage3DHost">createImage3DHost</a>() to create a host-accessible image.</p>
<p>Returns the new 3D OpenCL image object, or a null object if the image could not be created.</p>
<p>See also <a href="qclcontext.html#createImage3DHost">createImage3DHost</a>() and <a href="qclcontext.html#createImage3DCopy">createImage3DCopy</a>().</p>
<!-- @@@createImage3DDevice -->
<!-- $$$createImage3DHost[overload1]$$$createImage3DHostconstQCLImageFormat&void*intintintQCLMemoryObject::Accessintint -->
<h3 class="fn"><a name="createImage3DHost"></a><a href="qclimage3d.html">QCLImage3D</a> QCLContext::createImage3DHost ( const <a href="qclimageformat.html">QCLImageFormat</a> &amp; <i>format</i>, void * <i>data</i>, int <i>width</i>, int <i>height</i>, int <i>depth</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i>, int <i>bytesPerLine</i> = 0, int <i>bytesPerSlice</i> = 0 )</h3>
<p>Creates a 3D OpenCL image object with the specified <i>format</i>, <i>width</i>, <i>height</i>, <i>depth</i>, and <i>access</i> mode. If <i>bytesPerLine</i> is not zero, it indicates the number of bytes between lines in <i>data</i>. If <i>bytesPerSlice</i> is not zero, it indicates the number of bytes between slices in <i>data</i>.</p>
<p>If <i>data</i> is not null, then it will be used as the storage for the image. If <i>data</i> is null, then a new block of host-accessible memory will be allocated.</p>
<p>Returns the new 3D OpenCL image object, or a null object if the image could not be created.</p>
<p>See also <a href="qclcontext.html#createImage3DDevice">createImage3DDevice</a>() and <a href="qclcontext.html#createImage3DCopy">createImage3DCopy</a>().</p>
<!-- @@@createImage3DHost -->
<!-- $$$createProgramFromBinaries[overload1]$$$createProgramFromBinariesconstQList<QCLDevice>&constQList<QByteArray>& -->
<h3 class="fn"><a name="createProgramFromBinaries"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::createProgramFromBinaries ( const QList&lt;<a href="qcldevice.html">QCLDevice</a>&gt; &amp; <i>devices</i>, const QList&lt;QByteArray&gt; &amp; <i>binaries</i> )</h3>
<p>Creates an OpenCL program object from the list of <i>binaries</i> for <i>devices</i>. The <i>binaries</i> and <i>devices</i> lists must have the same number of elements.</p>
<p>See also <a href="qclcontext.html#createProgramFromBinaryCode">createProgramFromBinaryCode</a>() and <a href="qclcontext.html#createProgramFromBinaryFile">createProgramFromBinaryFile</a>().</p>
<!-- @@@createProgramFromBinaries -->
<!-- $$$createProgramFromBinaryCode[overload1]$$$createProgramFromBinaryCodeconstQByteArray& -->
<h3 class="fn"><a name="createProgramFromBinaryCode"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::createProgramFromBinaryCode ( const QByteArray &amp; <i>binary</i> )</h3>
<p>Creates an OpenCL program object from <i>binary</i> for <a href="qclcontext.html#defaultDevice">defaultDevice</a>().</p>
<p>This function can only load the binary for a single device. For multiple devices, use <a href="qclcontext.html#createProgramFromBinaries">createProgramFromBinaries</a>() instead.</p>
<p>See also <a href="qclcontext.html#createProgramFromBinaryFile">createProgramFromBinaryFile</a>() and <a href="qclcontext.html#createProgramFromBinaries">createProgramFromBinaries</a>().</p>
<!-- @@@createProgramFromBinaryCode -->
<!-- $$$createProgramFromBinaryFile[overload1]$$$createProgramFromBinaryFileconstQString& -->
<h3 class="fn"><a name="createProgramFromBinaryFile"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::createProgramFromBinaryFile ( const QString &amp; <i>fileName</i> )</h3>
<p>Creates an OpenCL program object from the binary data in <i>fileName</i> for <a href="qclcontext.html#defaultDevice">defaultDevice</a>().</p>
<p>See also <a href="qclcontext.html#createProgramFromBinaryCode">createProgramFromBinaryCode</a>() and <a href="qclcontext.html#createProgramFromBinaries">createProgramFromBinaries</a>().</p>
<!-- @@@createProgramFromBinaryFile -->
<!-- $$$createProgramFromSourceCode[overload1]$$$createProgramFromSourceCodeconstQByteArray& -->
<h3 class="fn"><a name="createProgramFromSourceCode"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::createProgramFromSourceCode ( const QByteArray &amp; <i>sourceCode</i> )</h3>
<p>Creates an OpenCL program object from the supplied <i>sourceCode</i>.</p>
<p>See also <a href="qclcontext.html#createProgramFromSourceFile">createProgramFromSourceFile</a>() and <a href="qclcontext.html#buildProgramFromSourceCode">buildProgramFromSourceCode</a>().</p>
<!-- @@@createProgramFromSourceCode -->
<!-- $$$createProgramFromSourceFile[overload1]$$$createProgramFromSourceFileconstQString& -->
<h3 class="fn"><a name="createProgramFromSourceFile"></a><a href="qclprogram.html">QCLProgram</a> QCLContext::createProgramFromSourceFile ( const QString &amp; <i>fileName</i> )</h3>
<p>Creates an OpenCL program object from the contents of the specified <i>fileName</i>.</p>
<p>See also <a href="qclcontext.html#createProgramFromSourceCode">createProgramFromSourceCode</a>() and <a href="qclcontext.html#buildProgramFromSourceFile">buildProgramFromSourceFile</a>().</p>
<!-- @@@createProgramFromSourceFile -->
<!-- $$$createSampler[overload1]$$$createSamplerboolQCLSampler::AddressingModeQCLSampler::FilterMode -->
<h3 class="fn"><a name="createSampler"></a><a href="qclsampler.html">QCLSampler</a> QCLContext::createSampler ( bool <i>normalizedCoordinates</i>, <a href="qclsampler.html#AddressingMode-enum">QCLSampler::AddressingMode</a> <i>addressingMode</i>, <a href="qclsampler.html#FilterMode-enum">QCLSampler::FilterMode</a> <i>filterMode</i> )</h3>
<p>Creates a sampler for this context from the arguments <i>normalizedCoordinates</i>, <i>addressingMode</i>, and <i>filterMode</i>.</p>
<!-- @@@createSampler -->
<!-- $$$createUserEvent[overload1]$$$createUserEvent -->
<h3 class="fn"><a name="createUserEvent"></a><a href="qcluserevent.html">QCLUserEvent</a> QCLContext::createUserEvent ()</h3>
<p>Creates a user event. Returns null if user events are not supported.</p>
<p>User events are a feature of OpenCL 1.1 which allows an application to insert a marker into the command queue. Commands that depend upon the marker will not be executed until the application triggers the user event with <a href="qcluserevent.html#setFinished">QCLUserEvent::setFinished</a>().</p>
<!-- @@@createUserEvent -->
<!-- $$$createVector[overload1]$$$createVectorintQCLMemoryObject::Access -->
<h3 class="fn"><a name="createVector"></a><a href="qclvector.html">QCLVector</a>&lt;T&gt; QCLContext::createVector ( int <i>size</i>, <a href="qclmemoryobject.html#Access-enum">QCLMemoryObject::Access</a> <i>access</i> = QCLMemoryObject::ReadWrite )</h3>
<p>Creates a host-accessible vector of <i>size</i> elements of type T on this context and returns it. The elements will be initially in an undefined state.</p>
<p>Note that the <i>access</i> mode indicates how the OpenCL device (e.g&#x2e; GPU) will access the vector. When the host maps the vector, it will always be mapped as ReadWrite.</p>
<p>See also <a href="qclcontext.html#createBufferHost">createBufferHost</a>().</p>
<!-- @@@createVector -->
<!-- $$$defaultCommandQueue[overload1]$$$defaultCommandQueue -->
<h3 class="fn"><a name="defaultCommandQueue"></a><a href="qclcommandqueue.html">QCLCommandQueue</a> QCLContext::defaultCommandQueue ()</h3>
<p>Returns the default command queue for <a href="qclcontext.html#defaultDevice">defaultDevice</a>(). If the queue has not been created, it will be created with the default properties of in-order execution of commands, and profiling disabled.</p>
<p>Use <a href="qclcontext.html#createCommandQueue">createCommandQueue</a>() to create a queue that supports out-of-order execution or profiling. For example:</p>
<pre class="highlightedCode brush: cpp">    QCLCommandQueue queue =
        context.createCommandQueue
            (CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE);
    context.setCommandQueue(queue);</pre>
<p>See also <a href="qclcontext.html#commandQueue">commandQueue</a>(), <a href="qclcontext.html#createCommandQueue">createCommandQueue</a>(), and <a href="qclcontext.html#lastError">lastError</a>().</p>
<!-- @@@defaultCommandQueue -->
<!-- $$$defaultDevice[overload1]$$$defaultDevice -->
<h3 class="fn"><a name="defaultDevice"></a><a href="qcldevice.html">QCLDevice</a> QCLContext::defaultDevice () const</h3>
<p>Returns the default device in use by this context, which is typically the first element of the <a href="qclcontext.html#devices">devices</a>() list; or a null <a href="qcldevice.html">QCLDevice</a> if the context has not been created yet.</p>
<p>See also <a href="qclcontext.html#devices">devices</a>().</p>
<!-- @@@defaultDevice -->
<!-- $$$devices[overload1]$$$devices -->
<h3 class="fn"><a name="devices"></a>QList&lt;<a href="qcldevice.html">QCLDevice</a>&gt; QCLContext::devices () const</h3>
<p>Returns the list of devices that are in use by this context. If the context has not been created, returns an empty list.</p>
<p>See also <a href="qclcontext.html#defaultDevice">defaultDevice</a>().</p>
<!-- @@@devices -->
<!-- $$$errorName[overload1]$$$errorNamecl_int -->
<h3 class="fn"><a name="errorName"></a>QString QCLContext::errorName ( cl_int <i>code</i> )<tt> [static]</tt></h3>
<p>Returns the name of the supplied OpenCL error <i>code</i>. For example, <tt>CL_SUCCESS</tt>, <tt>CL_INVALID_CONTEXT</tt>, etc.</p>
<p>See also <a href="qclcontext.html#lastError">lastError</a>().</p>
<!-- @@@errorName -->
<!-- $$$finish[overload1]$$$finish -->
<h3 class="fn"><a name="finish"></a>void QCLContext::finish ()</h3>
<p>Blocks until all previously queued commands on the active command queue have finished execution.</p>
<p>See also <a href="qclcontext.html#flush">flush</a>().</p>
<!-- @@@finish -->
<!-- $$$flush[overload1]$$$flush -->
<h3 class="fn"><a name="flush"></a>void QCLContext::flush ()</h3>
<p>Flushes all previously queued commands to the device associated with the active command queue. The commands are delivered to the device, but no guarantees are given that they will be executed.</p>
<p>See also <a href="qclcontext.html#finish">finish</a>().</p>
<!-- @@@flush -->
<!-- $$$isCreated[overload1]$$$isCreated -->
<h3 class="fn"><a name="isCreated"></a>bool QCLContext::isCreated () const</h3>
<p>Returns true if the underlying OpenCL <a href="qclcontext.html#contextId">contextId</a>() has been created; false otherwise.</p>
<p>See also <a href="qclcontext.html#create">create</a>() and <a href="qclcontext.html#setContextId">setContextId</a>().</p>
<!-- @@@isCreated -->
<!-- $$$lastError[overload1]$$$lastError -->
<h3 class="fn"><a name="lastError"></a>cl_int QCLContext::lastError () const</h3>
<p>Returns the last OpenCL error that occurred while executing an operation on this context or any of the objects created by the context. Returns CL_SUCCESS if the last operation succeeded.</p>
<p>See also <a href="qclcontext.html#setLastError">setLastError</a>() and <a href="qclcontext.html#errorName">errorName</a>().</p>
<!-- @@@lastError -->
<!-- $$$marker[overload1]$$$marker -->
<h3 class="fn"><a name="marker"></a><a href="qclevent.html">QCLEvent</a> QCLContext::marker ()</h3>
<p>Returns a marker event for the active command queue. The event will be signalled when all commands that were queued before this point have finished.</p>
<p>See also <a href="qclcontext.html#barrier">barrier</a>() and <a href="qclcontext.html#sync">sync</a>().</p>
<!-- @@@marker -->
<!-- $$$release[overload1]$$$release -->
<h3 class="fn"><a name="release"></a>void QCLContext::release ()<tt> [virtual]</tt></h3>
<p>Releases this context; destroying it if the reference count is zero. Does nothing if the context has not been created or is already released.</p>
<p>See also <a href="qclcontext.html#create">create</a>().</p>
<!-- @@@release -->
<!-- $$$setCommandQueue[overload1]$$$setCommandQueueconstQCLCommandQueue& -->
<h3 class="fn"><a name="setCommandQueue"></a>void QCLContext::setCommandQueue ( const <a href="qclcommandqueue.html">QCLCommandQueue</a> &amp; <i>queue</i> )</h3>
<p>Sets the context's active command <i>queue</i>. If <i>queue</i> is null, then <a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a>() will be used.</p>
<p>See also <a href="qclcontext.html#commandQueue">commandQueue</a>() and <a href="qclcontext.html#defaultCommandQueue">defaultCommandQueue</a>().</p>
<!-- @@@setCommandQueue -->
<!-- $$$setContextId[overload1]$$$setContextIdcl_context -->
<h3 class="fn"><a name="setContextId"></a>void QCLContext::setContextId ( cl_context <i>id</i> )</h3>
<p>Sets the native OpenCL context identifier associated with this object to <i>id</i>.</p>
<p>This function will call <tt>clRetainContext()</tt> to increase the reference count on <i>id</i>. If the identifier was previously set to something else, then <tt>clReleaseContext()</tt> will be called on the previous value.</p>
<p>See also <a href="qclcontext.html#contextId">contextId</a>() and <a href="qclcontext.html#create">create</a>().</p>
<!-- @@@setContextId -->
<!-- $$$setLastError[overload1]$$$setLastErrorcl_int -->
<h3 class="fn"><a name="setLastError"></a>void QCLContext::setLastError ( cl_int <i>error</i> )</h3>
<p>Sets the last error code to <i>error</i>.</p>
<p>See also <a href="qclcontext.html#lastError">lastError</a>() and <a href="qclcontext.html#errorName">errorName</a>().</p>
<!-- @@@setLastError -->
<!-- $$$supportedImage2DFormats[overload1]$$$supportedImage2DFormatscl_mem_flags -->
<h3 class="fn"><a name="supportedImage2DFormats"></a>QList&lt;<a href="qclimageformat.html">QCLImageFormat</a>&gt; QCLContext::supportedImage2DFormats ( cl_mem_flags <i>flags</i> ) const</h3>
<p>Returns the list of supported 2D image formats for processing images with the specified memory <i>flags</i>.</p>
<p>See also <a href="qclcontext.html#supportedImage3DFormats">supportedImage3DFormats</a>().</p>
<!-- @@@supportedImage2DFormats -->
<!-- $$$supportedImage3DFormats[overload1]$$$supportedImage3DFormatscl_mem_flags -->
<h3 class="fn"><a name="supportedImage3DFormats"></a>QList&lt;<a href="qclimageformat.html">QCLImageFormat</a>&gt; QCLContext::supportedImage3DFormats ( cl_mem_flags <i>flags</i> ) const</h3>
<p>Returns the list of supported 3D image formats for processing images with the specified memory <i>flags</i>.</p>
<p>See also <a href="qclcontext.html#supportedImage2DFormats">supportedImage2DFormats</a>().</p>
<!-- @@@supportedImage3DFormats -->
<!-- $$$sync[overload1]$$$sync -->
<h3 class="fn"><a name="sync"></a>void QCLContext::sync ()</h3>
<p>Synchronizes the host against the active command queue. This function will block until all currently queued commands have finished execution.</p>
<!-- @@@sync -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
